home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-08 | 42.2 KB | 1,161 lines | [TEXT/R*ch] |
- C.S.M.P. Digest Mon, 03 Aug 92 Volume 1 : Issue 156
-
- Today's Topics:
-
- HOW TO?: Large Arrays in Think C
- Macapp replacement announced.
- ResolveAlias bug?
- Mac's equivalent to PC's kbhit()?
- Speech Generation info wanted
- How to modify a resource in my application?
- FTP Source?
- SFRead question. (checked FAQ)
-
-
-
- The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
-
- The digest is a collection of article threads from the internet newsgroup
- comp.sys.mac.programmer. It is designed for people who read c.s.m.p. semi-
- regularly and want an archive of the discussions. If you don't know what a
- newsgroup is, you probably don't have access to it. Ask your systems
- administrator(s) for details. (This means you can't post questions to the
- digest.)
-
- Each issue of the digest contains one or more sets of articles (called
- threads), with each set corresponding to a 'discussion' of a particular
- subject. The articles are not edited; all articles included in this digest
- are in their original posted form (as received by our news server at
- cs.uoregon.edu). Article threads are not added to the digest until the last
- article added to the thread is at least one month old (this is to ensure that
- the thread is dead before adding it to the digest). Article threads that
- consist of only one message are generally not included in the digest.
-
- The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
- [128.223.8.8] in the directory /pub/mac/csmp-digest. The most recent issues
- are available from sumex-aim.stanford.edu [36.44.0.6] in the directory
- /info-mac/digest/csmp. If you don't have ftp capability, the sumex archive
- has a mail server; send a message with the text '$MACarch help' (no quotes)
- to LISTSERV@ricevm1.rice.edu for more information.
-
- The digest is also available via email. Just send a note saying that you
- want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
- automatically receive each new issue as it is created. Sorry, back issues
- are not available through the mailing list.
-
- Send administrative mail to mkelly@cs.uoregon.edu.
-
-
- -------------------------------------------------------
-
- From: niko@iastate.edu (Nikolaus E Schuessler)
- Subject: HOW TO?: Large Arrays in Think C
- Organization: Iowa State University, Ames, IA
- Date: Tue, 23 Jun 1992 15:46:57 GMT
-
- In article <1992Jun23.142654.3072@ncsu.edu> chouck@eos.ncsu.edu (CHRISTOPHER HOUCK) writes:
- >Is there any way to dimension an array of [625][64] floats in Think C?
- >I am getting Illegal Array bounds and Code overflow compiler errors.
- >Increasing the partion doesn't seem to affect this, and the code is in
- >its own segment. Any help would GREATLY be appreciated
- >
- >Thank you,
- >
- >Christopher R. Houck
- >chouck@eos.ncsu.edu
-
-
- Yes, but you have to use some C tricks to do it. (This problem shows up
- a lot when porting unix code.)
-
- First declare a pointer to a two dimensional array of floats. The syntax
- is something like this:
-
- float (*mypointer)[64];
-
-
- Then, malloc the memory (64 * 625 * sizeof(float)) at runtime and assign
- the pointer to mypointer (you probably have to cast the pointer so the
- types match).
-
- Then you have the equivalent of the 'float[625][64];' declaration.
-
-
- Question: Is the problem that the segment loader cannot determine when
- to load in segments belonging to arrays or something else?
- Can't THINK C just allocate the space in the project/executable
- and let the segment loader take over ???
-
- If not, why not automatically filter out big arrays and generate
- the needed code to allocate the space at runtime so a huge array
- declarations compile and work properly? That would make porting
- code a lot easier.
-
-
-
-
-
-
-
-
-
-
-
-
- - --
- - ------------------------------------------------------------------------------
- Niko Schuessler niko@iastate.edu
- Project Vincent Systems Manager
- Iowa State University
-
- +++++++++++++++++++++++++++
-
- From: suitti@ima.isc.com (Stephen Uitti)
- Organization: Interactive Systems, Cambridge, MA 02138-5302
- Date: Tue, 23 Jun 1992 19:16:37 GMT
-
- In article <1992Jun23.142654.3072@ncsu.edu> chouck@eos.ncsu.edu (CHRISTOPHER HOUCK) writes:
- >Is there any way to dimension an array of [625][64] floats in Think C?
- >I am getting Illegal Array bounds and Code overflow compiler errors.
- >Increasing the partion doesn't seem to affect this, and the code is in
- >its own segment. Any help would GREATLY be appreciated
-
- This comes up fairly often.
-
- 625 * 64 = 40,000. Even if this were single byte objects, it
- would exceed the 32K limit. Yes, this is a pain, but it isn't
- as bad as it sounds.
-
- You can get the same effect, but allocating the data space dynamically.
-
- typedef float FloatArray[625][64];
-
- FloatArray *myFloatArrayp;
-
- myFloatArrayp = (FloatArray *) NewPtr(sizeof(enctable));
- /* check for errors here */
-
- #define myFloatArray (*myFloatArray)
-
- Alternately, you can use the malloc() package.
-
- Stephen.
- suitti@ima.isc.com
-
- ---------------------------
-
- From: wirehead@cheshire.oxy.edu (David J. Harr)
- Subject: Macapp replacement announced.
- Organization: Occidental College, Los Angeles, CA 90041 USA.
- Date: Tue, 23 Jun 1992 15:35:22 GMT
-
-
- I haven't seen this here on the net yet, so I thought I'd post it. This was
- posted to the tcl mailing list by John Pugh, jpugh@apple.com.
-
- I have no connection with Apple or Symantec, blah, blah, blah.
-
- ```````````````````````````````````````````````````````````````````````````````
- PRESS RELEASE TEXT
- ```````````````````````````````````````````````````````````````````````````````
- For Immediate Release
-
- Contacts:
- Jackie Brinker
- Symantec Corporation
- (408) 446-7490
-
- Jackie Promes
- Apple Computer, Inc.
- (408) 974-3609
-
- Julie McHenry/Lerry Wilson
- Wilson McHenry Company
- (415) 592-7600
-
-
- Apple and Symantec Announce Plan to Help Speed Software Applications
- Development
-
- Cross-platform Software Development Solution
-
- NEW YORK-June 23, 1992-Symantec Corporation (NASDAQ: SYMC) and Apple Computer,
- Inc. (NASDAQ: AAPL) today announced a development and marketing agreement to
- provide a cross-platform application framework for Apple Macintosh computers
- and Microsoft Windows-based PCs. The agreement is designed to aid commercial
- and corporate software developers in quickly creating new applications for
- multiple desktop computing platforms.
-
- Symantec will provide the cross-platform application framework-known as the
- Bedrock framework-that it is currently using internally to develop
- applications for Apple Macintosh computers and Microsoft Windows. Symantec
- will leverage Apple engineering resources and Apple's current object-oriented
- framework technology, MacApp. Both Apple and Symantec will use the Bedrock
- framework technology internally, and work together to support the developer
- community's transition to the Bedrock framework.
-
- "Our customers face two major problems: a growing number of applications that
- need to be written, and a growing number of desktop computing platforms that
- need support," said Gordon Eubanks, president and CEO of Symantec. "The
- Bedrock framework developed from our internal technology, and enhanced by
- Apple's experience in object technology, will enable corporate customers and
- independent software developers to begin solving these problems."
-
- "This agreement will alter the dynamics of the personal computer software
- industry by decreasing development complexity and increasing developer
- opportunities," said Roger Heinen, senior vice president and general manager of
- Apple's Macintosh Software Architecture division. "Cross-platform development
- has been a very important requirement for out developers. We believe that
- Symantec, with Apple's assistance, will deliver the best solution."
-
- An application framework provides a common set of building blocks or "objects"
- that provide the basic structure for an application. The framework enables
- developers to more quickly and easily create applications while providing the
- freedom to innovate. MacApp, Apple's framework, has been successfully
- providing this support for Macintosh developers. The Bedrock framework extends
- state-of-the-art framework technology by enabling developers to use one
- framework to develop applications for multiple platforms.
-
- By applying the framework approach to cross-platform development, Symantec's
- Bedrock framework enables software developers to maintain a single version of
- source code for platform-specific versions of an application. In addition to
- shortening the development cycle, the cross-platform framework results in
- better product reliability and maintenance, as well as more efficient
- localization for global markets.
-
- The bedrock technology will be available commercially in the first half of 1993
- on Apple Macintosh and Microsoft Windows, with future versions supporting other
- desktop platforms such as IBM OS/2, UNIX and Microsoft NT. The product will be
- available internationally through both Apple and Symantec distribution
- channels.
-
- Symantec Corporation develops, markets and supports a complete line of
- application and system software products for IBM compatible PCs and Apple
- Macintosh computers, and development tools for leading desktop operating
- systems. Information on the company and products can be obtained by calling:
- (800) 441-7234 or (408) 252-3570.
-
- Apple Computer, Inc. develops, manufactures and markets computer technology for
- use in business, education and government. A recognized pioneer and innovator
- in the personal computer industry, Apple does business in more than 120
- countries.
-
- Note to Editors:
-
- For additional information on the Bedrock applications framework, please call
- (415) 592-7600 and request any of the following:
-
- o For technical information, request: Bedrock framework White Paper
- o For market information, request: Development Tools Market Backgrounder
- o For June 23, 1992 press conference remarks request: Symantec/Apple Bedrock
- Framework Remarks
- o For hardcopy of June 23, 1992 press presentation, request: Symantec/Apple
- press presentation
-
- Bedrock is a trademark of Symantec Corporation. Apple, the Apple logo,
- Macintosh and MacApp are registered trademarks of Apple Computer, Inc. Other
- brands and products are trademarks or registered trademarks of their respective
- holders and should be treated as such.
-
-
-
-
- ```````````````````````````````````````````````````````````````````````````````
- DEVELOPER Q&A TEXT
- ```````````````````````````````````````````````````````````````````````````````
- CROSS-PLATFORM FRAMEWORK Q & A
- 6/23/92
-
-
- Q. What is being announced today?
- A. Symantec Corporation and Apple Computer, Inc. today announced a development
- and marketing agreement to provide a cross-platform application framework,
- known as Bedrock, for Apple Macintosh computers and Microsoft
- Windows-based PCs. The agreement is designed to aid commercial and
- corporate software developers in quickly creating new applications for
- multiple desktop computing platforms.
-
- Q. Is this a product announcement?
- A. No. Apple and Symantec are announcing an agreement to develop a
- cross-platform product. Details and product announcement will follow at a
- time closer to product delivery.
-
- Q. What is an object-oriented application framework?
- A. An object-oriented application framework provides a common set of building
- blocks or "objects" that provide the basic structure for an application.
- It has a set of reusable class libraries that make up a generic application
- that the developer can customize with specific features. The framework
- enables commercial and in-house developers to more quickly and easily
- create applications while providing the freedom to innovate. MacApp,
- Apple's framework, has successfully provided this support for Macintosh
- developers. The Bedrock framework extends state-of-the-art framework
- technology by enabling developers to use one framework to develop
- applications for multiple platforms.
-
- Q. How does an application framework enable cross-platform development?
- A. An object-oriented application framework provides common abstractions for
- underlying platform specific facilities. By providing these higher-level
- abstractions on multiple platforms, programs developed with the framework
- are insulated from the differences between platforms but still maintain the
- native look and feel of the platform. This can be done, because the
- framework is object-oriented, without subscribing to the lowest-common
- denominator but to the highest common multiple, allowing developers to
- concentrate on the platform features they can adopt to differentiate their
- applications.
-
- Q. Who will use the Bedrock cross-platform application framework?
- A. The Bedrock technology is targeted for Macintosh and Windows developers who
- wish to create cross-platform applications, as well as developers of
- single-platform applications. A long-term goal for Apple and Symantec is
- to develop Bedrock technology into the best application framework available
- for development on either the Apple Macintosh or Microsoft Windows
- platforms. When Bedrock is delivered, Apple will propose to MacApp users
- and other developers a process for migrating from MacApp to the Bedrock
- framework.
-
- Q. Why is Apple doing a cross-platform application framework?
- A. --To develop a healthy, Macintosh developer community that creates
- innovative, successful applications on the Macintosh and other platforms
- without complete duplication of programming efforts.
- --To help ensure adoption of new, innovative, Apple technology on the
- Macintosh and other platforms.
-
- Q. How does the framework fit into Apple's software strategy?
- A. The cross-platform framework is an vital piece of Apple's software
- strategy, providing developers with easier access to new technology.
-
- Q. How does the Bedrock framework benefit Macintosh developers?
- A. Bedrock will enable Macintosh developers to create products for multiple
- platforms without incurring the expense of two complete but separate
- development teams. Unlike procedural cross-platform approaches, Bedrock
- will allow developers to concentrate on the meaningful differences of the
- platform, exploiting of the advantages of the Macintosh while developing
- for multiple platforms. Bedrock will also provide for easier adoption of
- new technology as it is encapsulated into the framework features.
-
- Q. Why is Apple entering into an agreement with Symantec?
- A. --To quickly make a cross-platform application framework available to
- developers.
- --Symantec has significant experience with Macintosh and Windows
- development tools and marketing.
- --Symantec is a respected development tools vendor.
- --After considerable investigation by our engineering team it was obvious
- that the Symantec framework is great technology.
- --Symantec has strong, well-established distribution channels.
-
- Q. What is the relationship between Apple and Symantec?
- A. Apple and Symantec signed an agreement to develop and distribute a
- cross-platform application framework. The framework will be built on
- Symantec's Bedrock application framework, a work-in-progress that is
- currently being used for development at Symantec. Apple will contribute
- engineers to the project which will leverage Apple's MacApp technology to
- bring the best possible cross-platform application framework to the market.
- Both companies will make the resulting product available to its customers
- and developers.
-
- Q. How much influence will Apple have on product design/development?
- A. Apple will be able to help drive timely implementation of new technology
- into the framework, enabling framework developers to more easily provide
- new features to customers.
-
- Q. Will the application framework provide a lowest-common denominator set of
- functionality?
- A. No. The intent is to provide a framework that allows the best possible
- application to be created on any platform and to take advantage of
- platform-specific features. This will allow developers to focus on the
- meaningful differences between platform APIs and cease coping with
- arbitrary differences between platform APIs.
-
- Q. Will Bedrock become an Apple product, or is Apple discontinuing MacApp/MPW?
- A. Apple views Bedrock as the successor to MacApp and has acquired rights to
- distribute both the Macintosh development kit, as well as to optionally
- distribute the runtime system as a DLL with its system software. Apple
- will be providing Bedrock support to developers and intends to distribute
- the Macintosh version as part of Apple's CD-based E.T.O.: EssentialsoToolso
- Objects tools product.
-
- Q. What are Apple's plans for future releases and support of MacApp?
- A. Because this is a technology announcement some of the product details have
- yet to be determined. After the Apple engineers have an opportunity to
- project the level to which they will be able to contribute to Bedrock we
- will determine if it will be necessary to introduce another version of
- MacApp. If Bedrock assumes all the features of MacApp 3 and more, the need
- for a future version of MacApp is greatly diminished.
-
- Q. Will this framework replace MacApp?
- A. You can think of Bedrock as the successor to MacApp
-
- Q. Why has Apple pushed MacApp for so long and now seems to be changing
- strategy?
- A. We feel very strongly that Bedrock is a continuation of the MacApp
- strategy, bringing the experience and know-how of Apple's MacApp
- development to a cross-platform, application framework.
-
- Q. What is the transition path for MacApp programmers to the new framework?
- A. Continue using MacApp. Bedrock is the successor to MacApp and you can
- expect a transition cost to get to the cross-platform framework. Apple will
- be developing services and tools to help ease the transition effort, but
- some recoding will be necessary. One thing to remember about the transition
- is that although some code will not transfer, many programming skills
- developed for MacApp will apply to Bedrock. If you are already using the
- MacApp framework, the learning curve to adopt Bedrock will be low.
-
- Q. Can I directly translate my MacApp code to Bedrock?
- A. You will not be able to directly translate MacApp code to Bedrock. There
- will be some effort required to make the transition. This is largely due to
- expanding the framework to encompass more than user interface function and
- provide cross-platform development. Apple will be providing services and
- tools to ease the transition effort.
-
- Q. What is the transition path for programmers, who do not use MacApp, to the
- framework?
- A. Macintosh programmers who do not use MacApp and who want to do
- cross-platform development need to look at the options. In most cases they
- may want to start MacApp development because the skills programmers acquire
- during a MacApp development project will transfer well to Bedrock. Further
- benefits will result from easier code transfer.
-
- Q. What programming skills are required to use the framework?
- A. A knowledge of C++ and object-oriented programming techniques.
-
- Q. Is the framework being developed in C++?
- A. Yes the framework is developed in C++ and allows full use of the language's
- features.
-
- Q. What C++ compilers can be used with the framework?
- A. Symantec intends to develop Bedrock to be compatible with most, if not all,
- of the standard C++ compilers available on the target platforms.
-
- Q. Will source code be provided to customers?
- A. That has not yet been determined.
-
- Q. When will the product ship?
- A. A Macintosh and Windows framework will be shipped during the first half of
- 1993.
-
- Q. How will the framework be distributed?
- A. The product will be distributed by Apple and Symantec through existing
- distribution channels.
-
- Q. Will it be available on E.T.O.?
- A. Apple intends to distribute an E.T.O. that includes Bedrock.
-
- Q. How can I get seeded with Bedrock? Is there any documentation or
- specifications available today?
- A. Symantec will not be soliciting "Early Developers" until the fall. At that
- time, we will make information about the program available.
-
- ************************************ END TEXT***********************************
-
- "I must remember to send her a thank-you bomb."
-
- David.
-
-
- ---------------------------
-
- From: zobkiw@world.std.com (Joe Zobkiw)
- Subject: ResolveAlias bug?
- Date: 24 Jun 92 00:10:31 GMT
- Organization: The World Public Access UNIX, Brookline, MA
-
- I am writing a backgroundOnly application that calls ResolveAlias on the
- alias of a System 7 File Sharing "server". The alias file was made via
- the Finder and I simply open it up, grab the "alis" resource and pass
- it into ResolveAlias(...) (Yes, I'm detaching the resource)
-
- My call to ResolveAlias(...) looks like this:
-
- err = ResolveAlias(nil, aliasH, &target, &wasChanged);
-
- When I break just before this call and step into the call I end up on a dc.w
- instruction that is illegal. I crash. However, I only crash if the server is
- NOT mounted at the time of the call. If it _is_ mounted, everything works
- fine and dandy.
-
- Am I missing some sort of pre-flighting that I need to do? Shouldn't this work
- properly? Should it ask to mount the server?
-
- Thanks in advance for any information on this.
-
- - --
- - -- joe zobkiw Internet: zobkiw@world.std.com
- - -- AOL: AFL Zobkiw
- - -- mac.synthesis.MIDI.THINK C.OOP
- - -- asm.comm.networks.cool tunes...
-
- +++++++++++++++++++++++++++
-
- From: dodd@apple.com (Mike Dodd)
- Date: Wed, 24 Jun 1992 21:26:18 GMT
- Organization: Apple Computer Inc.
-
- In article <BqBptK.FyK@world.std.com>, zobkiw@world.std.com (Joe Zobkiw) writes:
- >
- > I am writing a backgroundOnly application that calls ResolveAlias on the
- > alias of a System 7 File Sharing "server". The alias file was made via
- > the Finder and I simply open it up, grab the "alis" resource and pass
- > it into ResolveAlias(...) (Yes, I'm detaching the resource)
- >
- > My call to ResolveAlias(...) looks like this:
- >
- > err = ResolveAlias(nil, aliasH, &target, &wasChanged);
- >
- > When I break just before this call and step into the call I end up on a dc.w
- > instruction that is illegal. I crash. However, I only crash if the server is
- > NOT mounted at the time of the call. If it _is_ mounted, everything works
- > fine and dandy.
- >
-
- One possibility: the alias manager is trying to put up a dialog to mount
- the server, and is crashing because InitWindows hasn't been called. If you
- are initializing all the toolboxes, though, then I don't know why it would
- crash...
-
- - -Mike Dodd-
- Apple Computer
- ** What I say is my opinion. Not Apple's. **
-
-
- +++++++++++++++++++++++++++
-
- From: gurgle@netcom.com (Pete Gontier)
- Date: Thu, 25 Jun 92 05:40:03 GMT
- Organization: cellular
-
- dodd@apple.com (Mike Dodd) writes:
-
- > zobkiw@world.std.com (Joe Zobkiw) writes:
- >> I am writing a backgroundOnly application that calls ResolveAlias on the
- >> ...
- >> When I break just before this call and step into the call I end up on a dc.w
- >> instruction that is illegal. I crash. However, I only crash if the server is
- >> NOT mounted at the time of the call. If it _is_ mounted, everything works
- >> fine and dandy.
-
- >One possibility: the alias manager is trying to put up a dialog to mount
- >the server, and is crashing because InitWindows hasn't been called. If you
- >are initializing all the toolboxes, though, then I don't know why it would
- >crash...
-
- A background-only application doesn't call InitWindows.
-
- This sounds like a job for MatchAlias.
-
-
-
-
- - --
- Pete Gontier // EC Technology // gurgle@netcom.com
-
- +++++++++++++++++++++++++++
-
- From: speck@dat.ruc.dk (Peter Speck)
- Date: 25 Jun 92 09:19:33 GMT
- Organization: Roskilde Universitetscenter, Danmark
-
-
-
- In article <BqBptK.FyK@world.std.com> Joe Zobkiw, zobkiw@world.std.com writes:
- >err = ResolveAlias(nil, aliasH, &target, &wasChanged);
-
- You better use ResolveAliasFileMountOption to avoid getting the dialog. See TechNote#315:
- Resolving Alias Files Quietly.
-
- Peter Speck
-
- +++++++++++++++++++++++++++
-
- From: zobkiw@world.std.com (Joe Zobkiw)
- Date: 25 Jun 92 12:29:41 GMT
- Organization: The World Public Access UNIX, Brookline, MA
-
- It seems as though MatchAlias with the kARMNoUI option is for me ;)
-
- Thanks for all the help :)
-
-
- - --
- - -- joe zobkiw Internet: zobkiw@world.std.com
- - -- AOL: AFL Zobkiw
- - -- mac.synthesis.MIDI.THINK C.OOP
- - -- asm.comm.networks.cool tunes...
-
- ---------------------------
-
- From: fang@phy.duke.edu (Fang Zhong)
- Subject: Mac's equivalent to PC's kbhit()?
- Date: 24 Jun 92 03:36:45 GMT
-
-
- I am converting a program from MS QuickC to MPW C.
- I need to find a replacement of kbhit() from MS QuickC to
- something equivalent in MPW C. Is it a simple call to a
- toolbox function? Or I have to make it up from several
- calls? Please help me out on this.
- Thanks in advance.
-
-
- - --
- Fang Zhong 1-919-684-8247
- Duke University Dept. of Physics fang@phy.duke.edu
- Durham, N.C. 27706
-
- +++++++++++++++++++++++++++
-
- From: des7f@virginia.edu (Dave Sappington)
- Date: 24 Jun 92 08:37:50 GMT
- Organization: Institute for Parallel Computation, UVa
-
- fang@phy.duke.edu (Fang Zhong) wrote:
- > I am converting a program from MS QuickC to MPW C.
- > I need to find a replacement of kbhit() from MS QuickC to
- > something equivalent in MPW C. Is it a simple call to a
- > toolbox function? Or I have to make it up from several
- > calls? Please help me out on this.
-
- I don't know exactly what kbhit() does but you might want to investigate:
-
- Boolean KeyWasPressed(char *asciiCode)
- {
- EventRecord evt;
- Boolean result;
- #ifdef DefineThisIfYouDontWantToEatTheEvent
- result = EventAvail(keyDownMask,&evt) == keyDown;
- #else
- result = GetNextEvent(keyDownMask,&evt) == keyDown;
- #endif
- if (result)
- *asciiCode = evt.message & charCodeMask;
- else
- *asciiCode = 0; /* pick a value, any value ;-) */
- return result;
- }
-
- Boolean KeyIsDownNow(char *asciiCode)
- {
- KeyMap keys;
- Boolean result;
- char asciiCode;
-
- GetKeys(&keys);
- result = (keys[0] & keys[1] & keys[2] & keys[3]) != 0;
- if (result)
- *asciiCode = function of keys bitmap, take a look at KeyTrans();
- else
- *asciiCode = 0;
- return result;
- }
-
- Dave Sappington des7f@virginia.edu
- Institute for Parallel Computation des7f@virginia.bitnet
- University of Virginia
-
- +++++++++++++++++++++++++++
-
- From: dougm@cns.caltech.edu (Doug McNaught)
- Organization: California Institute of Technology
- Date: Thu, 25 Jun 1992 04:14:50 GMT
-
- In article <des7f-240692041032@fuse.ipc.virginia.edu.> des7f@virginia.edu (Dave Sappington) writes:
- fang@phy.duke.edu (Fang Zhong) wrote:
- > I am converting a program from MS QuickC to MPW C.
- > I need to find a replacement of kbhit() from MS QuickC to
- > something equivalent in MPW C. Is it a simple call to a
- > toolbox function? Or I have to make it up from several
- > calls? Please help me out on this.
-
- I don't know exactly what kbhit() does but you might want to investigate:
-
- Boolean KeyWasPressed(char *asciiCode)
- {
- EventRecord evt;
- Boolean result;
- #ifdef DefineThisIfYouDontWantToEatTheEvent
- result = EventAvail(keyDownMask,&evt) == keyDown;
- #else
- result = GetNextEvent(keyDownMask,&evt) == keyDown;
- ^^^^^^^^^^
- This isn't quite right. GetNextEvent returns a Boolean that basically
- says whether anything meaningful happened. You need to test evt.what
- against keyDown.
-
- #endif
- if (result)
- *asciiCode = evt.message & charCodeMask;
- else
- *asciiCode = 0; /* pick a value, any value ;-) */
- return result;
- }
-
- Boolean KeyIsDownNow(char *asciiCode)
- {
- KeyMap keys;
- Boolean result;
- char asciiCode;
-
- GetKeys(&keys);
- result = (keys[0] & keys[1] & keys[2] & keys[3]) != 0;
- ^ ^ ^
- You should use && here.
-
- if (result)
- *asciiCode = function of keys bitmap, take a look at KeyTrans();
- else
- *asciiCode = 0;
- return result;
- }
-
- - -doug
- - --
- Doug McNaught |"Sadder still to watch it die/ Then never to have
- dougm@cns.caltech.edu | known it/ For you, the blind who once could see/
- doug@midget.towson.edu | The bell tolls for thee..." --Neil Peart
- Nobody approves my opinions! Not even me, sometimes. Read at your own risk.
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@dront.nada.kth.se (Jon W{tte)
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Date: Mon, 29 Jun 1992 11:04:41 GMT
-
- ..caltech.edu> dougm@cns.caltech.edu (Doug McNaught) writes:
-
- result = EventAvail(keyDownMask,&evt) == keyDown;
-
- No, that won't work.
- I would say:
-
- if ( EventAvail ( keyDownMask | autoKeyMask , & evt ) ) {
-
- result = ( evt . what == keyDown || evt . what == autoKey ) ;
- }
-
-
-
- GetKeys(&keys);
- result = (keys[0] & keys[1] & keys[2] & keys[3]) != 0;
- ^ ^ ^
- You should use && here.
-
- Remind me not to hire these guys :-)
-
- No, you should use "|" or "||" - using & or using && will VERY SELDOM
- yield true, since you would have to hold down one key from every 32
- key codes for it to work...
-
- - --
- Jon W{tte, Svartmangatan 18, S-111 29 Stockholm, Sweden
-
- "Difficult, obscure, incoherent and nonstandard does not imply more power."
- - Andrew Kass in comp.sys.mac.hardware
-
- +++++++++++++++++++++++++++
-
- From: dougm@cns.caltech.edu (Doug McNaught)
- Organization: California Institute of Technology
- Date: Tue, 30 Jun 1992 08:46:44 GMT
-
- In article <D88-JWA.92Jun29120441@dront.nada.kth.se> d88-jwa@dront.nada.kth.se (Jon W{tte) writes:
-
- .caltech.edu> dougm@cns.caltech.edu (Doug McNaught) writes:
-
- result = EventAvail(keyDownMask,&evt) == keyDown;
-
- No, that won't work.
-
- This is not my mistake; it's his (the original poster's). Re-check
- your attribution.
-
- I would say:
-
- if ( EventAvail ( keyDownMask | autoKeyMask , & evt ) ) {
- result = ( evt . what == keyDown || evt . what == autoKey ) ;
- }
-
- So would I.
-
- GetKeys(&keys);
- result = (keys[0] & keys[1] & keys[2] & keys[3]) != 0;
- ^ ^ ^
- You should use && here.
-
- Remind me not to hire these guys :-)
-
- No, you should use "|" or "||" - using & or using && will VERY SELDOM
- yield true, since you would have to hold down one key from every 32
- key codes for it to work...
-
- You're definitely right here. I got hung up on the "bitwise-vs-logical"
- error and missed the "and-vs-or" mistake. But, it's something I'dve
- caught pretty fast if I were actually dealing with the code.
- So, do I get the job? :)
-
- - -doug
-
- - --
- Doug McNaught |"Sadder still to watch it die/ Then never to have
- dougm@cns.caltech.edu | known it/ For you, the blind who once could see/
- doug@midget.towson.edu | The bell tolls for thee..." --Neil Peart
- Nobody approves my opinions! Not even me, sometimes. Read at your own risk.
-
- ---------------------------
-
- From: hurf@theory.TC.Cornell.EDU (Hurf Sheldon)
- Subject: Speech Generation info wanted
- Organization: Cornell Theory Center
- Date: Wed, 24 Jun 1992 15:31:25 GMT
-
- I would like a brain dump to get current on what's available in
- speech generation applications runnable on a power book or laptop.
-
- My motivation:
- My good friend (and mother in law) is a victim of ALS which
- causes a slow deterioration in the muscle tissue, most notably
- the larynx and esophagus. As she was frustrated at speaking
- recently she said "Can't you get me a keyboard I can type what I
- want to say and have it come out spoken? I can still type,
- I can't talk." Of course, she thinks I can do anything with
- computers...
-
-
- Needless to say this started me thinking... I am quite willing to
- hack away at things.
-
-
- thanks in advance
-
- hurf
-
- - --
- Hurf Sheldon Network: hurf@graphics.cornell.edu
- Program of Computer Graphics Phone: 607 255 6713
-
- 580 Eng. Theory Center, Cornell University, Ithaca, N.Y. 14853
-
- +++++++++++++++++++++++++++
-
- From: psfales@cbnewsc.cb.att.com (Peter Fales)
- Date: 26 Jun 92 01:35:18 GMT
- Organization: AT&T
-
- In article <1992Jun24.153125.28865@tc.cornell.edu> hurf@theory.TC.Cornell.EDU (Hurf Sheldon) writes:
- > I would like a brain dump to get current on what's available in
- > speech generation applications runnable on a power book or laptop.
- >
- > My motivation:
- > My good friend (and mother in law) is a victim of ALS which
- > causes a slow deterioration in the muscle tissue, most notably
- > the larynx and esophagus. As she was frustrated at speaking
- > recently she said "Can't you get me a keyboard I can type what I
- > want to say and have it come out spoken? I can still type,
- > I can't talk." Of course, she thinks I can do anything with
- > computers...
-
- There are several approaches to this, but I suggest the following
- because 1) It's relatively cheap, 2) relatively simple, and 3) I'm
- pretty sure it would work. I have been playing recently with the
- speech synthesis module made by RC systems. All you need is a 5 volt
- power supply, a small speaker, and a cable to connect it to the PC's
- parallel port. It looks to the computer like a printer and will "speak"
- anything that is sent to the printer port. The text-to-speech
- algorithms are really quite good, and the provide some ways to tweek
- it if you need to.
-
- The RC System V8600 costs around $150 in single quantities.
-
- RC Systems can be reached at
-
- 121 West Winesap Road
- Bothell, WA 98012
- (206)672-6909.
-
-
- I have no connection with RC systems except as a satisfied customer.
-
- - --
- Peter Fales AT&T, Room 6M-234
- N9IYJ 2000 N. Naperville Rd.
- UUCP: ...att!ihlpb!psfales Naperville, IL 60566
- Domain: psfales@ihlpb.att.com work: (708) 979-8031
-
- ---------------------------
-
- From: jerry@uni-paderborn.de (Gerald Siek)
- Subject: How to modify a resource in my application?
- Date: 24 Jun 92 16:40:22 GMT
- Organization: Uni-GH Paderborn
-
- Hello wizards !
-
- How can I modify an application-defined resource while the application runs?
- I have tried the following code (suggested in IM I, page 123):
-
- Handle TheResource;
-
- TheResource = GetResource( 'pref', 128 ) /* Get the old resource */
-
- SomeModifcations(TheResource); /* Apply my modifications */
-
- HNoPurge(TheResource); /* Make res. temporarily unpurgable */
- ChangedResource(TheResource); /* Mark it as changed */
- WriteResource(TheResource); /* Write it back */
- HPurge(TheResource); /* Make res. purgeable again */
-
- The modification routine does not call any system routines, it just changes
- a few bytes manually.
-
- This code simply does not work. Strange enough, it writes the text of my
- apple menu (!) into the resource and deletes the apple menu, probably because
- of some side-effects while using the handle. Have I made a dumb mistake?
- Any help is greatly appreciated!
-
- Thanks!
- Jerry
- - --
- Gerald Siek - jerry@uni-paderborn.de - University of Paderborn, Germany
-
- +++++++++++++++++++++++++++
-
- Organization: University of Illinois at Chicago
- Date: Wednesday, 24 Jun 1992 21:25:37 CDT
- From: <U11852@uicvm.uic.edu>
-
- Gerald Siek asks:
- >>>>>>
- How can I modify an application-defined resource while the application runs?
- I have tried the following code (suggested in IM I, page 123):
- [code sample deleted...]
- >>>>>>
- No, for God's sake! the proper sequence of calls should be as follows:
- h:=GetResource('prec',128);
- HLock(h);
- SomeModifications(h); {possibly dereferencing the handle...h^^}
- HUnlock(h);
- WriteResource(h);
- .....
- The Resource manager will ALWAYS be nice to you when you "enclose" ONLY
- your modification part with HLock/HUnLock-HNoPurge/HPurge and operate
- on the resources AS RELOCATABLE HANDLES ALWAYS. NEVER LOCKED OR NOPURGED.
- Note, on the code above, the call to WriteResource operates on a floating
- NON-locked, NON-nonpurged handle.
- Hope that helps.
- John Galidakis/MathGradUIC
- "Who am I, What am I? As I am, I am not. But as we are, I AM. And
- you my creation, My Perfect Love is your Perfect Freedom. And I will be
- with you forever and ever, until the End, and then forever more." -
-
- +++++++++++++++++++++++++++
-
- Organization: University of Illinois at Chicago
- Date: Wednesday, 24 Jun 1992 21:34:38 CDT
- From: <U11852@uicvm.uic.edu>
-
- Herr, oops; I forgot the ChangedResource(h); call just before the
- WriteResource(h) call. The correct sequence is then:
- h:=GetResource(prec,128);
- HLock(h);
- Modify(h); {here}
- HUnLock(h);
- ChangedResource(h); {mark changes permanent}
- WriteResource(h); {Update resource file}
- Sorry for the mistake.
- John Galidakis/MathGradUIC
-
- ---------------------------
-
- From: mmalson@x102a.ess.harris.com (Mark Malson)
- Subject: FTP Source?
- Date: 24 Jun 92 18:31:12 GMT
- Organization: Harris Corporation, GCSD, Melbourne, FL
-
- Sorry if this is a FAQ...
-
- Where can I get a (large) snippet of code that implements FTP? I
- have searched and searched for NCSA Telnet source (I THOUGHT it
- was public domain) and can't find it.
-
- I have a need to transfer files via FTP in a really strange way; I
- can't use any existing FTP programs to do it, so I have to adapt
- one.
-
- - - Mark
-
- +++++++++++++++++++++++++++
-
- From: jbrowne@void.ncsa.uiuc.edu (Jim Browne)
- Organization: University of Illinois at Urbana
- Date: Wed, 24 Jun 1992 23:21:03 GMT
-
- mmalson@x102a.ess.harris.com (Mark Malson) writes:
-
-
- >I
- >have searched and searched for NCSA Telnet source (I THOUGHT it
- >was public domain) and can't find it.
-
- Just because you can't find the source doesn't mean it's not PD. It is PD, and
- as they say on TV "It's in there!(tm)"
-
- How about trying ftpbin.c? You think that might work? ;)
-
- - --
- Jim Browne | jbrowne@ncsa.uiuc.edu |
- NCSA/STG System Administrator | stgadmin@ncsa.uiuc.edu |
- System Administration: Where the fun never ends... | (217) 244-7798 |
- "I was ionized... but now I'm better." - Bukaroo Banzai
-
- +++++++++++++++++++++++++++
-
- From: sanguish@digifix.com (Scott Anguish)
- Organization: Digital Fix Development
- Date: Thu, 25 Jun 1992 02:28:37 GMT
-
- Jim Browne writes
- > mmalson@x102a.ess.harris.com (Mark Malson) writes:
- >
- >
- > >I
- > >have searched and searched for NCSA Telnet source (I THOUGHT it
- > >was public domain) and can't find it.
- >
-
- Probably the easiest thing would be to get the VersaTerm package. I
- think it comes with Comm ToolBox clients, and you could just communicate with
- the CTB. Thats documented, should be debugged... etc..
-
- Give Versaterm a call. There are also other FTP CommToolBox options.
-
- - --
- - - Scott Anguish -
- sanguish@digifix.com (NextMail)
-
-
- +++++++++++++++++++++++++++
-
- From: timm@void.ncsa.uiuc.edu (Coffee Junkie)
- Organization: University of Illinois at Urbana
- Date: Thu, 25 Jun 1992 04:20:00 GMT
-
- Scott Anguish writes
- > Jim Browne writes
- > > mmalson@x102a.ess.harris.com (Mark Malson) writes:
- > >
- > >
- > > >I
- > > >have searched and searched for NCSA Telnet source (I THOUGHT it
- > > >was public domain) and can't find it.
- > >
- >
- > Probably the easiest thing would be to get the VersaTerm package. I
- > think it comes with Comm ToolBox clients, and you could just communicate
- with
- > the CTB. Thats documented, should be debugged... etc..
- >
- > Give Versaterm a call. There are also other FTP CommToolBox options.
- >
- > --
- > - Scott Anguish -
- > sanguish@digifix.com (NextMail)
-
- Hmm...sorry, I missed the first post...the source is available via anonymous
- ftp from ftp.ncsa.uiuc.edu.
-
- - --
- Tim McClarren | "...a bajillion brilliant Jobsian lithium licks."
- timm@ncsa.uiuc.edu|
- (217)244-0015 |
-
- +++++++++++++++++++++++++++
-
- From: jbrowne@void.ncsa.uiuc.edu (Jim Browne)
- Date: 25 Jun 92 19:24:16 GMT
- Organization: University of Illinois at Urbana
-
- timm@void.ncsa.uiuc.edu (Coffee Junkie) writes:
-
- >Scott Anguish writes
- >> Jim Browne writes
- >> > mmalson@x102a.ess.harris.com (Mark Malson) writes:
- >> >
- >> >
- >> > >I
- >> > >have searched and searched for NCSA Telnet source (I THOUGHT it
- >> > >was public domain) and can't find it.
- >> >
- >>
-
- Doh! Forgive me, I read that as I've searched THE NCSA Telnet source...
-
- I need a vacation.
-
- - --
- Jim Browne | jbrowne@ncsa.uiuc.edu |
- NCSA/STG System Administrator | stgadmin@ncsa.uiuc.edu |
- System Administration: Where the fun never ends... | (217) 244-7798 |
- "I was ionized... but now I'm better." - Bukaroo Banzai
-
- ---------------------------
-
- From: egw@utkvx4.utk.edu (Wolpert, Edward Greenwal)
- Subject: SFRead question. (checked FAQ)
- Organization: University of Tennessee Computing Center
- Date: Wed, 24 Jun 1992 19:52:00 GMT
-
- This is (I hope) a simple question... I'm having trouble with the FSRead
- command. When I call it, I get only garbage. I'm using the following
- routine in think pascal 4.0...
-
-
- Count:= sizeof (String[1]Var);
- ErrCode:= FSRead(FileRefNum, Count, @String[1]Var);
-
- I'm dealing with a text file, and String[1]Var is a variable of
- String[1] type. (of course.) However, String[1]Var becomes garbage, a
- line of random length, with part of my desired text read in. I do a setFpos
- command before, so I know it's not that. Can anyone help?
-
-
- Virtually,
- Edward Wolpert
-
- - ------------------------------------------------- EGW@UTKVX
- Vladimir: It's Godot! At last! Gogo! It's Godot! | EGW@utkvx.utk.edu
- We're saved! | I'm responsible for my
- Estragon: I'm in hell! | actions, are you
- -S. Beckett | responsible for yours?
- - -------------------------------------------------
-
-
- +++++++++++++++++++++++++++
-
- Organization: University of Illinois at Chicago
- Date: Wednesday, 24 Jun 1992 21:41:31 CDT
- From: <U11852@uicvm.uic.edu>
-
- Wolpert, Edward Greenwal writes:
- >>>>>>>
- Count:= sizeof (String[1]Var);
- ErrCode:= FSRead(FileRefNum, Count, @String[1]Var);
- <<<<<<<
- This is a quite common programming bug that used to byte me on a regular
- basis. AVOID USING A STRING VAR BUFFER on your FSRead calls. Use a
- "buffer:packed array[1..n] of char; or even a single char"; using a
- string will almost always crash, unless: You pass the pointer to the
- first byte of the string which is at an ODD address so you will crash again.
- (if str:string[n], then the string starts at an even boundary, that is
- str[0] (length byte) but @str[1] is odd. Avoid all this mess, and use
- a simple @buffer[1].
- Then transfer your buffer to your string, possibly using a blockMove, or
- a Pascal loop.
- Hope this helps
- John Galidakis/MathGradUIC
- "Who am I, What am I? As I am, I am not. But as we are, I AM. And
- you my creation, My Perfect Love is your Perfect Freedom. And I will be
- with you forever and ever, until the End, and then forever more." -
-
- ---------------------------
-
- End of C.S.M.P. Digest
- **********************
-